<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>18_函数参数高级-案例练习-计算参数的和</title>
    </head>
    <body>
        <script>
            // 需求：调用sum方法 就可以求和

            function sum(){

                var s = 0;
                for(var i = 0; i < arguments.length;i++){
                    s += arguments[i];
                }
                return s;
            }

            var result = sum(1,2,3,4,5);
            console.log(result);
        </script>
    </body>
</html>